#include "StdAfx.h"
#include "DxShader.h"

#include "Utility\FileManager.h"



DxShader::DxShader(void)
{

}


DxShader::~DxShader(void)
{

}

char* DxShader::LoadShaderData(char* szPath)
{
	char fullPath[128];
	FileManager::GetFullFilePath(szPath, fullPath, sizeof(fullPath));

	FILE* pFile = 0;
	fopen_s(&pFile, fullPath, "rb");

	if( pFile )
	{
		//get the length of the file
		fseek(pFile, 0, SEEK_END);
		int iSize = ftell(pFile);

		//go back to start
		fseek(pFile, 0, SEEK_SET);

		char* shader = new char[iSize];

		fread_s(shader, iSize, iSize, 1, pFile);

		//close the file
		fclose(pFile);

		return shader;
	}



	return 0;
}

